package com.iexbuy.ihg.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.RatingBar;

import com.iexbuy.ihg.App;
import com.iexbuy.ihg.R;
import com.iexbuy.ihg.adapter.RecommentListAdapter;
import com.iexbuy.ihg.common.CommUtil;
import com.iexbuy.ihg.entity.DealHistoryDetailObject;
import com.iexbuy.ihg.entity.ReComment;
import com.iexbuy.ihg.net.ServiceHelper;
import com.iexbuy.ihg.utils.ToastUtils;
import com.jingchen.pulltorefresh.PullToRefreshLayout;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class WeDeSettingFragment extends BaseFragment {

	private static WeDeSettingFragment homeFragmentInstent;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		homeFragmentInstent = this;
	}

	@Override
	protected View _onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.fragment_wede_setting, container, false);
		ViewUtils.inject(this, rootView);
		initView(rootView);
		return rootView;
	}

	private void initView(View rootView) {
		mBaseActivity.setTitle(getResources().getString(R.string.we_de_about));
		mBaseActivity.setTitleLayoutVisibility(true);
		mBaseActivity.setHomeActivity(false);

	}

	@OnClick(R.id.checkUpdateLayout)
	public void checkUpdateLayoutClick(View view) {
		ToastUtils.toast(mBaseActivity, "当前版本已是最新版本。");
	}

	@OnClick(R.id.cleadCacheLayout)
	public void cleadCacheLayoutClick(View view) {
		App.bitmapUtils.clearCache();
		App.bitmapUtils.clearDiskCache();
		ToastUtils.toast(mBaseActivity, "已清除图片缓存");
	}

	@OnClick(R.id.aboutMeLayout)
	public void aboutMeLayoutClick(View view) {
		CommUtil.openSingleFragmentActivity(mBaseActivity, WeDeAboutFragment.class);
	}


	/**
	 * @return the homeFragmentInstent
	 */
	public static WeDeSettingFragment getHomeFragmentInstent() {
		return homeFragmentInstent;
	}

}
